/*
 * Copyright(c) 2018-? the original author[Wien(luweien@aliyun.com)] or authors.
 *
 */
package org.doll.it.base.domain;

import javax.persistence.MappedSuperclass;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* DO(Domain/Data Object)基类，仅包含操作者
* 
* @author Wien(luweien@aliyun.com)
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@MappedSuperclass
public class BaseOnlyOperatorDO extends BaseDO {

	private static final long serialVersionUID = -1898609513994495716L;

	/**
	 * 创建人
	 */
	@CreatedBy
	protected Long createdBy;

	/**
	 * 最后修改人
	 */
	@LastModifiedBy
	protected Long lastModifiedBy;

	/**
	 * 是否新建：当id为空 或者 创建人为空时
	 */
	@Override
	public boolean isNew() {
		return id == null || createdBy == null;
	}

}
